Micron Document
🎖️GitЯра🎖️


Displaying Raw • View renderedDownload

.specify/extensions/git/README.md 74dfd43ec2c13af9feb9b6c5fccf55977d83adb1 (74dfd43e) Text, 4.34 KB

Tc9d1d9# Git Branching Workflow Extension

Git repository initialization, feature branch creation, numbering (sequential/timestamp), validation, remote detection, and auto-commit for Spec Kit.

Tc9d1d9## Overview

This extension provides Git operations as an optional, self-contained module. It manages:

Tff7b72- **Repository initialization** with configurable commit messages
Tff7b72- **Feature branch creation** with sequential (Ta5d6ff`001-feature-name`) or timestamp (Ta5d6ff`20260319-143022-feature-name`) numbering
Tff7b72- **Branch validation** to ensure branches follow naming conventions
Tff7b72- **Git remote detection** for GitHub integration (e.g., issue creation)
Tff7b72- **Auto-commit** after core commands (configurable per-command with custom messages)

Tc9d1d9## Commands

| Command | Description |
|---------|-------------|
| Ta5d6ff`speckit.git.initialize` | Initialize a Git repository with a configurable commit message |
| Ta5d6ff`speckit.git.feature` | Create a feature branch with sequential or timestamp numbering |
| Ta5d6ff`speckit.git.validate` | Validate current branch follows feature branch naming conventions |
| Ta5d6ff`speckit.git.remote` | Detect Git remote URL for GitHub integration |
| Ta5d6ff`speckit.git.commit` | Auto-commit changes (configurable per-command enable/disable and messages) |

Tc9d1d9## Hooks

| Event | Command | Optional | Description |
|-------|---------|----------|-------------|
| Ta5d6ff`before_constitution` | Ta5d6ff`speckit.git.initialize` | No | Init git repo before constitution |
| Ta5d6ff`before_specify` | Ta5d6ff`speckit.git.feature` | No | Create feature branch before specification |
| Ta5d6ff`before_clarify` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before clarification |
| Ta5d6ff`before_plan` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before planning |
| Ta5d6ff`before_tasks` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before task generation |
| Ta5d6ff`before_implement` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before implementation |
| Ta5d6ff`before_checklist` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before checklist |
| Ta5d6ff`before_analyze` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before analysis |
| Ta5d6ff`before_taskstoissues` | Ta5d6ff`speckit.git.commit` | Yes | Commit outstanding changes before issue sync |
| Ta5d6ff`after_constitution` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after constitution update |
| Ta5d6ff`after_specify` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after specification |
| Ta5d6ff`after_clarify` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after clarification |
| Ta5d6ff`after_plan` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after planning |
| Ta5d6ff`after_tasks` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after task generation |
| Ta5d6ff`after_implement` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after implementation |
| Ta5d6ff`after_checklist` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after checklist |
| Ta5d6ff`after_analyze` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after analysis |
| Ta5d6ff`after_taskstoissues` | Ta5d6ff`speckit.git.commit` | Yes | Auto-commit after issue sync |

Tc9d1d9## Configuration

Configuration is stored in Ta5d6ff`.specify/extensions/git/git-config.yml`:

Ta5d6ff```Ta5d6ffyaml
T8b949e# Branch numbering strategy: "sequential" or "timestamp"
Tff7b72branch_numberingTb4b4b4: Ta5d6ffsequential

T8b949e# Custom commit message for git init
Tff7b72init_commit_messageTb4b4b4: Ta5d6ff"Ta5d6ff[SpecTe6edf3 Ta5d6ffKit]Te6edf3 Ta5d6ffInitialTe6edf3 Ta5d6ffcommitTa5d6ff"

T8b949e# Auto-commit per command (all disabled by default)
T8b949e# Example: enable auto-commit after specify
Tff7b72auto_commitTb4b4b4:
Tff7b72defaultTb4b4b4: Ta5d6fffalse
Tff7b72after_specifyTb4b4b4:
Tff7b72enabledTb4b4b4: Ta5d6fftrue
Tff7b72messageTb4b4b4: Ta5d6ff"Ta5d6ff[SpecTe6edf3 Ta5d6ffKit]Te6edf3 Ta5d6ffAddTe6edf3 Ta5d6ffspecificationTa5d6ff"
Ta5d6ff```

Tc9d1d9## Installation

Ta5d6ff```Ta5d6ffbash
T8b949e# Install the bundled git extension (no network required)
specify extension add git
Ta5d6ff```

Tc9d1d9## Disabling

Ta5d6ff```Ta5d6ffbash
T8b949e# Disable the git extension (spec creation continues without branching)
specify extension disable git

T8b949e# Re-enable it
specify extension Tffa657enable git
Ta5d6ff```

Tc9d1d9## Graceful Degradation

When Git is not installed or the directory is not a Git repository:
Tff7b72- Spec directories are still created under Ta5d6ff`specs/`
Tff7b72- Branch creation is skipped with a warning
Tff7b72- Branch validation is skipped with a warning
Tff7b72- Remote detection returns empty results

Tc9d1d9## Scripts

The extension bundles cross-platform scripts:

Tff7b72- Ta5d6ff`scripts/bash/create-new-feature.sh` — Bash implementation
Tff7b72- Ta5d6ff`scripts/bash/git-common.sh` — Shared Git utilities (Bash)
Tff7b72- Ta5d6ff`scripts/powershell/create-new-feature.ps1` — PowerShell implementation
Tff7b72- Ta5d6ff`scripts/powershell/git-common.ps1` — Shared Git utilities (PowerShell)

Served by rngit 1.5.4 - Generated in 0.04s